<?php
	
	echo'<h2>Actions de communication</h2>';
	$nb = true;
	if($actions != false)
	{
		foreach ($actions as $action)
		{
			if($action->getEtat()->getLibelle() == 'Terminé' || $action->getEtat()->getLibelle() == 'Noté')
			{
				foreach($notes as $note)
				{
					if($nb)
					{
						echo '<table class="table_pointBonus">
									<tr>
										<th>Titre</th>
										<th>Point gagné</th>
										<th>Point max de l\'action</th>
									</tr>';
						$nb = false;
					}
	
					if($action->getId() == $note->getAction()->getId() && is_null($note->getNote()))
					{
						echo '	<tr>
									<td>'.show($action->getTitre()).'</td>
									<td>En cours de notation</td>
									<td>'.$action->getNoteMax().'</td>
								</tr>';
					}
					else if($action->getId() == $note->getAction()->getId())
					{
						echo '	<tr>
									<td>'.show($action->getTitre()).'</td>
									<td>'.$note->getNote().'</td>
									<td>'.$action->getNoteMax().'</td>
								</tr>';
					}
				}
			}
		}
	}
	
	if($nb)
		echo 'Vous n\'avez aucun point bonus.';
	else 
		echo '</table>';
	
	echo '<h2>Forums</h2>';
	$nbF = true;
	if($forums != false)
	{
		foreach ($forums as $forum)
		{
			if($forum->getEtat()->getLibelle() == 'Terminé' || $forum->getEtat()->getLibelle() == 'Noté')
			{
				if($nbF)
				{
					echo '	<table class="table_pointBonus">
								<tr>
									<th>Titre</th>
									<th>Point gagné</th>
									<th>Point max du forum</th>
								</tr>';
					$nbF = false;
				}
				echo '<tr>';
				echo '<td>'.show($forum->getTitre()).'</td>';
				if($etudiant->getId() == $forum->getEtudiant1()->getId() && is_null($forum->getNoteEtu1()))
				{
					echo '<td>En cours de notation</td>';
				}
				else if($etudiant->getId() == $forum->getEtudiant1()->getId())
				{
					echo '<td>'.$forum->get_note_etu1().'</td>';
				}
				elseif($etudiant->getId() == $forum->getEtudiant2()->getId() && is_null($forum->getNoteEtu2()))
				{
					echo '<td>En cours de notation</td>';
				}
				elseif($etudiant->getId() == $forum->getEtudiant2()->getId())
				{
					echo '<td>'.$forum->getNoteEtu2().'</td>';
				}
				echo '<td>'.$forum->getNoteMax().'</td>';
				echo '</tr>';
			}
		}
	}
	
	if($nbF)
		echo 'Vous n\'avez aucun point bonus.';
	else
		echo '</table>';
?>